﻿using FPSO.Models.Domain;
using FPSO.Services.Utils;
using FPSO.ViewModel.Controls;
using System;

namespace FPSO.Services.Impl
{
    /// <summary>
    /// 真实的液货舱 服务实现
    /// </summary>
    public class RealOilBallastServiceImpl : IOilBallastService
    {
        private TSMapperBrige valueBrige;
        public RealOilBallastServiceImpl(string pdbConnStr, UCOilBallastViewModel viewModel)
        {
            SnapTSService tsService = new SnapTSService();
            tsService.ConnStr = pdbConnStr;
            valueBrige = new TSMapperBrige(tsService);
            valueBrige.InitDataContext(viewModel);
        }

        public void ReflushData(DateTime currentTime)
        {
			//DEBUG
			//valueBrige.UpdateValues();
			valueBrige.UpdateValues_tagList();

		}

        public void ReflushData(ManualCalcResult calcResult)
        {
            valueBrige.UpdateValues(calcResult);
        }
    }
}
